{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "xlyptNJ2ICnN"
      },
      "source": [
        "# Stable Diffusion WebUI Colab\n",
        "Colab NoteBook Created by [licyk](https://github.com/licyk)\n",
        "\n",
        "Jupyter Notebook 仓库：[licyk/sd-webui-all-in-one](https://github.com/licyk/sd-webui-all-in-one)\n",
        "\n",
        "这是适用于 [Colab](https://colab.research.google.com) 部署 [Stable-Diffusion-WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) / [Stable-Diffusion-WebUI-Forge](https://github.com/lllyasviel/stable-diffusion-webui-forge) / [Stable-Diffusion-WebUI-reForge](https://github.com/Panchovix/stable-diffusion-webui-reForge) / [Stable-Diffusion-WebUI-Forge-Classic](https://github.com/Haoming02/sd-webui-forge-classic) / [Stable-Diffusion-WebUI-AMDGPU](https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu) / [SD.Next](https://github.com/vladmandic/sdnext) 的 Jupyter Notebook，使用时请按顺序执行 Jupyter Notebook 单元。\n",
        "\n",
        "Colab 链接：<a href=\"https://colab.research.google.com/github/licyk/sd-webui-all-in-one/blob/main/notebook/stable_diffusion_webui_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
        "\n",
        "\n",
        "## 功能\n",
        "1. 环境配置：配置安装的 PyTorch 版本、内网穿透的方式，并安装 Stable Diffusion WebUI。默认设置下已启用`配置环境完成后立即启动 Stable Diffusion WebUI`选项，则安装完成后将直接启动 Stable Diffusion WebUI，并显示访问地址。\n",
        "2. 下载模型：下载可选列表中的模型（可选）。\n",
        "3. 自定义模型下载：使用链接下载模型（可选）。\n",
        "4. 扩展下载：使用链接下载扩展（可选）。\n",
        "5. 启动 Stable Diffusion WebUI：启动 Stable Diffusion WebUI，并显示访问地址。\n",
        "\n",
        "\n",
        "## 使用\n",
        "1. 在 Colab -> 代码执行程序 > 更改运行时类型 -> 硬件加速器 选择`GPU T4`或者其他 GPU。\n",
        "2. `环境配置`单元中的选项通常不需要修改，保持默认即可。如需切换其他 Stable Diffusion WebUI 分支，可修改`环境配置`单元中的`Stable Diffusion WebUI 分支预设`选项。\n",
        "3. 运行`环境配置`单元，默认设置下已启用`配置环境完成后立即启动 Stable Diffusion WebUI`选项，则环境配置完成后立即启动 Stable Diffusion WebUI，此时将弹出 Google Drive 授权页面，根据提示进行操作。配置完成后将启动 Stable Diffusion WebUI，Stable Diffusion WebUI 的访问地址可在日志中查看。\n",
        "4. 如果未启用`配置环境完成后立即启动 Stable Diffusion WebUI`选项，需要运行`启动 Stable Diffusion WebUI`单元，此时将弹出 Google Drive 授权页面，根据提示进行操作。配置完成后将启动 Stable Diffusion WebUI，Stable Diffusion WebUI 的访问地址可在日志中查看。\n",
        "5. 提示词查询工具：[SD 绘画提示词查询](https://licyk.github.io/t/tag)\n",
        "\n",
        "\n",
        "## 提示\n",
        "1. Colab 在关机后将会清除所有数据，所以每次重新启动时必须运行`环境配置`单元才能运行`启动 Stable Diffusion WebUI`单元。\n",
        "2. [Ngrok](https://ngrok.com) 内网穿透在使用前需要填写 Ngrok Token，可在 [Ngrok](https://ngrok.com) 官网获取。\n",
        "3. [Zrok](https://zrok.io) 内网穿透在使用前需要填写 Zrok Token, 可在 [Zrok](https://docs.zrok.io/docs/getting-started) 官网获取。\n",
        "4. 每次启动 Colab 后必须运行`环境配置`单元，才能运行`启动 Stable Diffusion WebUI`单元启动 Stable Diffusion WebUI。\n",
        "5. 其他功能有自定义模型下载等功能，根据自己的需求进行使用。\n",
        "6. 运行`启动 Stable Diffusion WebUI`时将弹出 Google Drive 访问授权提示，根据提示进行授权。授权后，使用 Stable Diffusion WebUI 生成的图片将保存在 Google Drive 的`sd_webui_output`文件夹中。\n",
        "7. 在`额外挂载目录设置`中可以挂载一些额外目录，如 LoRA 模型目录，挂载后的目录可在 Google Drive 的`sd_webui_output`文件夹中查看和修改。可通过该功能在 Google Drive 上传模型并在 Stable Diffusion WebUI 中使用。\n",
        "8. 默认挂载以下目录到 Google Drive，可在 Google Drive 的`sd_webui_output`文件夹中上传和修改文件：`outputs`, `config_states`, `params.txt`, `config.json`, `ui-config.json`, `styles.csv`\n",
        "9. Stable Diffusion WebUI 使用教程可阅读：</br>[SD WebUI 部署与使用 - SD Note](https://sdnote.netlify.app/guide/sd_webui)</br>[SD WebUI Forge 部署与使用 - SD Note](https://sdnote.netlify.app/guide/sd_webui_forge)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "VjYy0F2gZIPR"
      },
      "outputs": [],
      "source": [
        "#@title 👇 环境配置\n",
        "# SD WebUI All In One 功能初始化部分, 通常不需要修改\n",
        "# 如果需要查看完整代码实现, 可阅读: https://github.com/licyk/sd-webui-all-in-one/blob/main/sd_webui_all_in_one\n",
        "#################################################################################################################\n",
        "# SD_WEBUI_ALL_IN_ONE_URL, FORCE_DOWNLOAD_CORE 参数可根据需求修改, 通常保持默认即可\n",
        "SD_WEBUI_ALL_IN_ONE_URL = \"https://github.com/licyk/sd-webui-all-in-one@main\" # SD WebUI All In One 核心下载地址\n",
        "FORCE_DOWNLOAD_CORE = False # 设置为 True 时, 即使 SD WebUI All In One 已存在也会重新下载\n",
        "#################################################################################################################\n",
        "import os\n",
        "import sys\n",
        "from pathlib import Path\n",
        "try:\n",
        "    _ = JUPYTER_ROOT_PATH  # type: ignore # noqa: F821\n",
        "except Exception:\n",
        "    JUPYTER_ROOT_PATH = os.getcwd()\n",
        "!python -c \"import sd_webui_all_in_one\" &> /dev/null && [ \"{FORCE_DOWNLOAD_CORE}\" != \"True\" ] || python -m pip install \"git+{SD_WEBUI_ALL_IN_ONE_URL}\"\n",
        "from sd_webui_all_in_one import logger, VERSION, SDWebUIManager\n",
        "logger.info(\"SD WebUI All In One 核心模块初始化完成, 版本: %s\", VERSION)\n",
        "\n",
        "#######################################################\n",
        "\n",
        "# Stable Diffusion WebUI 分支预设\n",
        "SD_WEBUI_BRANCH_PRESET_DICT = {\n",
        "    \"AUTOMATIC1111/Stable-Diffusion-WebUI 主分支\": {\n",
        "        \"url\": \"https://github.com/AUTOMATIC1111/stable-diffusion-webui\",\n",
        "        \"branch\": \"master\",\n",
        "        \"requirements\": \"requirements_versions.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-load-model-at-start --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"AUTOMATIC1111/Stable-Diffusion-WebUI 测试分支\": {\n",
        "        \"url\": \"https://github.com/AUTOMATIC1111/stable-diffusion-webui\",\n",
        "        \"branch\": \"dev\",\n",
        "        \"requirements\": \"requirements_versions.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-load-model-at-start --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"lllyasviel/Stable-Diffusion-WebUI-Forge 分支\": {\n",
        "        \"url\": \"https://github.com/lllyasviel/stable-diffusion-webui-forge\",\n",
        "        \"branch\": \"main\",\n",
        "        \"requirements\": \"requirements_versions.txt\",\n",
        "        \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_forge_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"Panchovix/Stable-Diffusion-WebUI-reForge 主分支\": {\n",
        "        \"url\": \"https://github.com/Panchovix/stable-diffusion-webui-reForge\",\n",
        "        \"branch\": \"main\",\n",
        "        \"requirements\": \"requirements_versions.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"Panchovix/Stable-Diffusion-WebUI-reForge 测试分支\": {\n",
        "        \"url\": \"https://github.com/Panchovix/stable-diffusion-webui-reForge\",\n",
        "        \"branch\": \"dev\",\n",
        "        \"requirements\": \"requirements_versions.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"Haoming02/Stable-Diffusion-WebUI-Forge-Classic 分支\": {\n",
        "        \"url\": \"https://github.com/Haoming02/sd-webui-forge-classic\",\n",
        "        \"branch\": \"classic\",\n",
        "        \"requirements\": \"requirements.txt\",\n",
        "        \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_forge_classic_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"Haoming02/Stable-Diffusion-WebUI-Forge-Neo 分支\": {\n",
        "        \"url\": \"https://github.com/Haoming02/sd-webui-forge-classic\",\n",
        "        \"branch\": \"neo\",\n",
        "        \"requirements\": \"requirements.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --xformers --api --skip-python-version-check --skip-version-check --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"lshqqytiger/Stable-Diffusion-WebUI-AMDGPU 分支\": {\n",
        "        \"url\": \"https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu\",\n",
        "        \"branch\": \"master\",\n",
        "        \"requirements\": \"requirements_versions.txt\",\n",
        "        \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--theme dark --api --skip-torch-cuda-test --skip-python-version-check --skip-version-check --no-download-sd-model --enable-insecure-extension-access\",\n",
        "    },\n",
        "    \"vladmandic/SD.NEXT 主分支\": {\n",
        "        \"url\": \"https://github.com/vladmandic/sdnext\",\n",
        "        \"branch\": \"master\",\n",
        "        \"requirements\": \"requirements.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--use-cuda --use-xformers --enable_insecure_extension_access\",\n",
        "    },\n",
        "    \"vladmandic/SD.NEXT 测试分支\": {\n",
        "        \"url\": \"https://github.com/vladmandic/sdnext\",\n",
        "        \"branch\": \"dev\",\n",
        "        \"requirements\": \"requirements.txt\",\n",
        "        # \"requirements_url\": \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_requirements_versions.txt\",\n",
        "        \"launch_args\": \"--use-cuda --use-xformers --enable_insecure_extension_access\",\n",
        "    },\n",
        "}\n",
        "\n",
        "#@markdown ## Stable Diffusion WebUI 核心配置选项\n",
        "#@markdown - Stable Diffusion WebUI 分支预设：\n",
        "SD_WEBUI_BRANCH_PRESET = \"lllyasviel/Stable-Diffusion-WebUI-Forge 分支\" # @param [\"AUTOMATIC1111/Stable-Diffusion-WebUI 主分支\", \"AUTOMATIC1111/Stable-Diffusion-WebUI 测试分支\", \"lllyasviel/Stable-Diffusion-WebUI-Forge 分支\", \"Panchovix/Stable-Diffusion-WebUI-reForge 主分支\", \"Panchovix/Stable-Diffusion-WebUI-reForge 测试分支\", \"Haoming02/Stable-Diffusion-WebUI-Forge-Classic 分支\", \"Haoming02/Stable-Diffusion-WebUI-Forge-Neo 分支\", \"lshqqytiger/Stable-Diffusion-WebUI-AMDGPU 分支\", \"vladmandic/SD.NEXT 主分支\", \"vladmandic/SD.NEXT 测试分支\"]\n",
        "#@markdown - Stable Diffusion WebUI 启动预设文件地址：\n",
        "SD_WEBUI_SETTING = \"https://github.com/licyk/sd-webui-all-in-one/raw/main/config/sd_webui_config.json\" #@param {type:\"string\"}\n",
        "#@markdown - Stable Diffusion WebUI 分支仓库地址（可选，不填则使用分支预设值）：\n",
        "SD_WEBUI_REPO_OPT = \"\" #@param {type:\"string\"}\n",
        "#@markdown - Stable Diffusion WebUI 分支（可选，不填则使用分支预设值）：\n",
        "SD_WEBUI_BRANCH_OPT = \"\" #@param {type:\"string\"}\n",
        "#@markdown - Stable Diffusion WebUI 依赖表名（可选，不填则使用分支预设值）：\n",
        "SD_WEBUI_REQUIREMENTS_OPT = \"\" #@param {type:\"string\"}\n",
        "#@markdown - Stable Diffusion WebUI 启动参数（可选，不填则使用分支预设值）：\n",
        "SD_WEBUI_LAUNCH_ARGS_OPT = \"\" #@param {type:\"string\"}\n",
        "#@markdown - Stable Diffusion WebUI 新依赖表下载地址（可选，不填则使用分支预设值）：\n",
        "SD_WEBUI_REQUIREMENTS_URL_OPT = \"\" #@param {type:\"string\"}\n",
        "#@markdown ---\n",
        "#@markdown ## PyTorch 组件版本选项：\n",
        "#@markdown - PyTorch：\n",
        "PYTORCH_VER = \"torch==2.8.0+cu126 torchvision==0.23.0+cu126 torchaudio==2.8.0+cu126\" #@param {type:\"string\"}\n",
        "#@markdown - xFormers：\n",
        "XFORMERS_VER = \"xformers==0.0.32.post2\" #@param {type:\"string\"}\n",
        "#@markdown ---\n",
        "#@markdown ## 包管理器选项：\n",
        "#@markdown - 使用 uv 作为 Python 包管理器\n",
        "USE_UV = True #@param {type:\"boolean\"}\n",
        "#@markdown - PyPI 主镜像源\n",
        "PIP_INDEX_MIRROR = \"https://pypi.python.org/simple\" #@param {type:\"string\"}\n",
        "#@markdown - PyPI 扩展镜像源\n",
        "PIP_EXTRA_INDEX_MIRROR = \"https://download.pytorch.org/whl/cu126\" #@param {type:\"string\"}\n",
        "#@markdown - PyPI 额外镜像源\n",
        "PIP_FIND_LINKS_MIRROR = \"https://licyk.github.io/t/pypi/index_hf.html\" #@param {type:\"string\"}\n",
        "#@markdown - PyTorch 镜像源\n",
        "PYTORCH_MIRROR = \"https://download.pytorch.org/whl/cu126\" #@param {type:\"string\"}\n",
        "#@markdown ---\n",
        "#@markdown ## 内网穿透选项：\n",
        "#@markdown - 使用 remote.moe 内网穿透\n",
        "USE_REMOTE_MOE = True #@param {type:\"boolean\"}\n",
        "#@markdown - 使用 localhost.run 内网穿透\n",
        "USE_LOCALHOST_RUN = True #@param {type:\"boolean\"}\n",
        "#@markdown - 使用 pinggy.io 内网穿透\n",
        "USE_PINGGY_IO = True #@param {type:\"boolean\"}\n",
        "#@markdown - 使用 CloudFlare 内网穿透\n",
        "USE_CLOUDFLARE = True #@param {type:\"boolean\"}\n",
        "#@markdown - 使用 Gradio 内网穿透\n",
        "USE_GRADIO = True #@param {type:\"boolean\"}\n",
        "#@markdown - 使用 Ngrok 内网穿透（需填写 Ngrok Token，可在 [Ngrok](https://ngrok.com) 官网获取）\n",
        "USE_NGROK = True #@param {type:\"boolean\"}\n",
        "#@markdown - Ngrok Token\n",
        "NGROK_TOKEN = \"\"  #@param {type:\"string\"}\n",
        "#@markdown - 使用 Zrok 内网穿透（需填写 Zrok Token，可在 [Zrok](https://docs.zrok.io/docs/getting-started) 官网获取）\n",
        "USE_ZROK = True #@param {type:\"boolean\"}\n",
        "#@markdown - Zrok Token\n",
        "ZROK_TOKEN = \"\"  #@param {type:\"string\"}\n",
        "#@markdown ---\n",
        "#@markdown ## 快速启动选项：\n",
        "#@markdown - 配置环境完成后立即启动 Stable Diffusion WebUI（并挂载 Google Drive）\n",
        "QUICK_LAUNCH = True #@param {type:\"boolean\"}\n",
        "#@markdown - 不重复配置环境（当重复运行环境配置时将不会再进行安装）\n",
        "NO_REPEAT_CONFIGURE_ENV = True #@param {type:\"boolean\"}\n",
        "#@markdown ---\n",
        "#@markdown ## 其他选项：\n",
        "#@markdown - 清理无用日志\n",
        "CLEAR_LOG = True #@param {type:\"boolean\"}\n",
        "#@markdown - 检查可用 GPU\n",
        "CHECK_AVALIABLE_GPU = True #@param {type:\"boolean\"}\n",
        "#@markdown - 启用 TCMalloc 内存优化\n",
        "ENABLE_TCMALLOC = True #@param {type:\"boolean\"}\n",
        "#@markdown - 启用 CUDA Malloc 显存优化\n",
        "ENABLE_CUDA_MALLOC = True #@param {type:\"boolean\"}\n",
        "#@markdown - 更新内核和扩展\n",
        "UPDATE_CORE = True #@param {type:\"boolean\"}\n",
        "\n",
        "# 预设参数处理\n",
        "SD_WEBUI_REPO = SD_WEBUI_REPO_OPT or SD_WEBUI_BRANCH_PRESET_DICT.get(SD_WEBUI_BRANCH_PRESET).get(\"url\")\n",
        "SD_WEBUI_BRANCH = SD_WEBUI_BRANCH_OPT or SD_WEBUI_BRANCH_PRESET_DICT.get(SD_WEBUI_BRANCH_PRESET).get(\"branch\")\n",
        "SD_WEBUI_REQUIREMENTS = SD_WEBUI_REQUIREMENTS_OPT or SD_WEBUI_BRANCH_PRESET_DICT.get(SD_WEBUI_BRANCH_PRESET).get(\"requirements\")\n",
        "SD_WEBUI_LAUNCH_ARGS = SD_WEBUI_LAUNCH_ARGS_OPT or SD_WEBUI_BRANCH_PRESET_DICT.get(SD_WEBUI_BRANCH_PRESET).get(\"launch_args\")\n",
        "SD_WEBUI_REQUIREMENTS_URL = SD_WEBUI_REQUIREMENTS_URL_OPT or SD_WEBUI_BRANCH_PRESET_DICT.get(SD_WEBUI_BRANCH_PRESET).get(\"requirements_url\")\n",
        "\n",
        "# @markdown ---\n",
        "#######################################################\n",
        "# @markdown ## 扩展设置, 在安装时将会下载选择的扩展：\n",
        "EXTENSION_LIST = []\n",
        "\n",
        "ultimate_upscale_for_automatic1111 = True # @param  {type:\"boolean\"}\n",
        "a1111_sd_webui_tagcomplete = True # @param  {type:\"boolean\"}\n",
        "adetailer = True # @param  {type:\"boolean\"}\n",
        "sd_webui_infinite_image_browsing = True # @param  {type:\"boolean\"}\n",
        "sd_webui_openpose_editor = True # @param  {type:\"boolean\"}\n",
        "sd_webui_prompt_all_in_one = True # @param  {type:\"boolean\"}\n",
        "sd_webui_wd14_tagger = True # @param  {type:\"boolean\"}\n",
        "stable_diffusion_webui_localization_zh_hans = True # @param  {type:\"boolean\"}\n",
        "sd_webui_mosaic_outpaint = True # @param  {type:\"boolean\"}\n",
        "sd_webui_resource_monitor = True # @param  {type:\"boolean\"}\n",
        "sd_webui_tcd_sampler = True # @param  {type:\"boolean\"}\n",
        "advanced_euler_sampler_extension = True # @param  {type:\"boolean\"}\n",
        "sd_webui_regional_prompter = True # @param  {type:\"boolean\"}\n",
        "sd_webui_model_converter = True # @param  {type:\"boolean\"}\n",
        "sd_webui_controlnet = False # @param  {type:\"boolean\"}\n",
        "multidiffusion_upscaler_for_automatic1111 = False # @param  {type:\"boolean\"}\n",
        "sd_dynamic_thresholding = False # @param  {type:\"boolean\"}\n",
        "sd_webui_lora_block_weight = False # @param  {type:\"boolean\"}\n",
        "stable_diffusion_webui_model_toolkit = False # @param  {type:\"boolean\"}\n",
        "a1111_sd_webui_haku_img = True # @param  {type:\"boolean\"}\n",
        "sd_webui_supermerger = False # @param  {type:\"boolean\"}\n",
        "sd_webui_segment_anything = False # @param  {type:\"boolean\"}\n",
        "sd_forge_hypertile_svd_z123 = True # @param  {type:\"boolean\"}\n",
        "sd_forge_layerdiffuse = True # @param  {type:\"boolean\"}\n",
        "sd_webui_licyk_style_image = True # @param  {type:\"boolean\"}\n",
        "sdwebui_close_confirmation_dlalogue = True # @param  {type:\"boolean\"}\n",
        "stable_diffusion_webui_zoomimage = True # @param  {type:\"boolean\"}\n",
        "\n",
        "ultimate_upscale_for_automatic1111 and EXTENSION_LIST.append(\"https://github.com/Coyote-A/ultimate-upscale-for-automatic1111\")\n",
        "a1111_sd_webui_tagcomplete and EXTENSION_LIST.append(\"https://github.com/DominikDoom/a1111-sd-webui-tagcomplete\")\n",
        "adetailer and EXTENSION_LIST.append(\"https://github.com/Bing-su/adetailer\")\n",
        "sd_webui_infinite_image_browsing and EXTENSION_LIST.append(\"https://github.com/zanllp/sd-webui-infinite-image-browsing\")\n",
        "sd_webui_openpose_editor and EXTENSION_LIST.append(\"https://github.com/huchenlei/sd-webui-openpose-editor\")\n",
        "sd_webui_prompt_all_in_one and EXTENSION_LIST.append(\"https://github.com/Physton/sd-webui-prompt-all-in-one\")\n",
        "sd_webui_wd14_tagger and EXTENSION_LIST.append(\"https://github.com/licyk/sd-webui-wd14-tagger\")\n",
        "stable_diffusion_webui_localization_zh_hans and EXTENSION_LIST.append(\"https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans\")\n",
        "sd_webui_mosaic_outpaint and EXTENSION_LIST.append(\"https://github.com/Haoming02/sd-webui-mosaic-outpaint\")\n",
        "sd_webui_resource_monitor and EXTENSION_LIST.append(\"https://github.com/Haoming02/sd-webui-resource-monitor\")\n",
        "sd_webui_tcd_sampler and EXTENSION_LIST.append(\"https://github.com/licyk/sd-webui-tcd-sampler\")\n",
        "advanced_euler_sampler_extension and EXTENSION_LIST.append(\"https://github.com/licyk/advanced_euler_sampler_extension\")\n",
        "sd_webui_regional_prompter and EXTENSION_LIST.append(\"https://github.com/hako-mikan/sd-webui-regional-prompter\")\n",
        "sd_webui_model_converter and EXTENSION_LIST.append(\"https://github.com/Akegarasu/sd-webui-model-converter\")\n",
        "sd_webui_controlnet and EXTENSION_LIST.append(\"https://github.com/Mikubill/sd-webui-controlnet\")\n",
        "multidiffusion_upscaler_for_automatic1111 and EXTENSION_LIST.append(\"https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111\")\n",
        "sd_dynamic_thresholding and EXTENSION_LIST.append(\"https://github.com/mcmonkeyprojects/sd-dynamic-thresholding\")\n",
        "sd_webui_lora_block_weight and EXTENSION_LIST.append(\"https://github.com/hako-mikan/sd-webui-lora-block-weight\")\n",
        "stable_diffusion_webui_model_toolkit and EXTENSION_LIST.append(\"https://github.com/arenasys/stable-diffusion-webui-model-toolkit\")\n",
        "a1111_sd_webui_haku_img and EXTENSION_LIST.append(\"https://github.com/licyk/a1111-sd-webui-haku-img\")\n",
        "sd_webui_supermerger and EXTENSION_LIST.append(\"https://github.com/hako-mikan/sd-webui-supermerger\")\n",
        "sd_webui_segment_anything and EXTENSION_LIST.append(\"https://github.com/continue-revolution/sd-webui-segment-anything\")\n",
        "sd_forge_hypertile_svd_z123 and EXTENSION_LIST.append(\"https://github.com/licyk/sd_forge_hypertile_svd_z123\")\n",
        "sd_forge_layerdiffuse and EXTENSION_LIST.append(\"https://github.com/lllyasviel/sd-forge-layerdiffuse\")\n",
        "sd_webui_licyk_style_image and EXTENSION_LIST.append(\"https://github.com/licyk/sd-webui-licyk-style-image\")\n",
        "sdwebui_close_confirmation_dlalogue and EXTENSION_LIST.append(\"https://github.com/w-e-w/sdwebui-close-confirmation-dialogue\")\n",
        "stable_diffusion_webui_zoomimage and EXTENSION_LIST.append(\"https://github.com/viyiviyi/stable-diffusion-webui-zoomimage\")\n",
        "\n",
        "# @markdown ---\n",
        "##############################################################################\n",
        "# @markdown ## 模型设置, 在安装时将会下载选择的模型：\n",
        "SD_MODEL = []\n",
        "\n",
        "# @markdown - Stable Diffusion 模型\n",
        "v1_5_pruned_emaonly = False # @param  {type:\"boolean\"}\n",
        "animefull_final_pruned = False # @param  {type:\"boolean\"}\n",
        "sd_xl_base_1_0_0_9vae = False # @param  {type:\"boolean\"}\n",
        "sd_xl_refiner_1_0_0_9vae = False # @param  {type:\"boolean\"}\n",
        "sd_xl_turbo_1_0_fp16 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_3_0_base = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_3_0 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_3_1 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_4_0 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_4_0_opt = False # @param  {type:\"boolean\"}\n",
        "holodayo_xl_2_1 = False # @param  {type:\"boolean\"}\n",
        "kivotos_xl_2_0 = False # @param  {type:\"boolean\"}\n",
        "clandestine_xl_1_0 = False # @param  {type:\"boolean\"}\n",
        "UrangDiffusion_1_1 = False # @param  {type:\"boolean\"}\n",
        "RaeDiffusion_XL_v2 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_delta_rev1 = False # @param  {type:\"boolean\"}\n",
        "kohakuXLEpsilon_rev1 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_epsilon_rev2 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_epsilon_rev3 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_zeta = False # @param  {type:\"boolean\"}\n",
        "starryXLV52_v52 = False # @param  {type:\"boolean\"}\n",
        "heartOfAppleXL_v20 = False # @param  {type:\"boolean\"}\n",
        "heartOfAppleXL_v30 = False # @param  {type:\"boolean\"}\n",
        "sanaexlAnimeV10_v10 = False # @param  {type:\"boolean\"}\n",
        "sanaexlAnimeV10_v11 = False # @param  {type:\"boolean\"}\n",
        "SanaeXL_Anime_v1_2_aesthetic = False # @param  {type:\"boolean\"}\n",
        "SanaeXL_Anime_v1_3_aesthetic = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v0_1 = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v0_1_GUIDED = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v1_0 = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v1_1 = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v2_0_stable = False # @param  {type:\"boolean\"}\n",
        "jruTheJourneyRemains_v25XL = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_earlyAccessVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred05Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred075 = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred077 = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred10Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred11Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPredTestVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred05Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred06Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred065SVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred075SVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred09RVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred10Version = True # @param  {type:\"boolean\"}\n",
        "ponyDiffusionV6XL_v6StartWithThisOne = False # @param  {type:\"boolean\"}\n",
        "pdForAnime_v20 = False # @param  {type:\"boolean\"}\n",
        "omegaPonyXLAnime_v20 = False # @param  {type:\"boolean\"}\n",
        "# @markdown - VAE 模型\n",
        "vae_ft_ema_560000_ema_pruned = False # @param  {type:\"boolean\"}\n",
        "vae_ft_mse_840000_ema_pruned = False # @param  {type:\"boolean\"}\n",
        "sdxl_fp16_fix_vae = True # @param  {type:\"boolean\"}\n",
        "# @markdown - VAE Approx 模型\n",
        "vae_approx_model = True # @param  {type:\"boolean\"}\n",
        "vae_approx_sdxl = True # @param  {type:\"boolean\"}\n",
        "vae_approx_sd3 = True # @param  {type:\"boolean\"}\n",
        "# @markdown - 放大模型\n",
        "upscale_dat_x2 = False # @param {type:\"boolean\"}\n",
        "upscale_dat_x3 = False # @param {type:\"boolean\"}\n",
        "upscale_dat_x4 = True # @param {type:\"boolean\"}\n",
        "upscale_4x_nmkd_superscale_sp_178000_g = False # @param {type:\"boolean\"}\n",
        "upscale_8x_nmkd_superscale_150000_g = False # @param {type:\"boolean\"}\n",
        "upscale_lollypop = False # @param {type:\"boolean\"}\n",
        "upscale_realesrgan_x4plus = False # @param {type:\"boolean\"}\n",
        "upscale_realesrgan_x4plus_anime_6b = True # @param {type:\"boolean\"}\n",
        "upscale_swinir_4x = False # @param {type:\"boolean\"}\n",
        "# @markdown - ControlNet 模型\n",
        "illustriousxlcanny_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxllineart_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxldepth_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlsoftedge_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxllineartrrealistic_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlshuffle_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlopenpose_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxltile_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv0_1_inpainting_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_canny_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_depth_midas_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_inpainting_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_tile_fp16 = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epscanny = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsdepthmidas = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epslineartanime = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsnormalmidas = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epssoftedgehed = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsmangaline = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epslineartrealistic = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsdepthmidasv11 = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsscribblehed = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsscribblepidinet = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_openposemodel = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epstile = False # @param {type:\"boolean\"}\n",
        "noobai_inpainting_controlnet = False # @param {type:\"boolean\"}\n",
        "noobipamark1_mark1 = False # @param {type:\"boolean\"}\n",
        "\n",
        "\n",
        "# Stable Diffusion 模型\n",
        "v1_5_pruned_emaonly and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sd_1.5/v1-5-pruned-emaonly.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animefull_final_pruned and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sd_1.5/animefull-final-pruned.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sd_xl_base_1_0_0_9vae and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sd_xl_base_1.0_0.9vae.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sd_xl_refiner_1_0_0_9vae and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sd_xl_refiner_1.0_0.9vae.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sd_xl_turbo_1_0_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sd_xl_turbo_1.0_fp16.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_3_0_base and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-3.0-base.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_3_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-3.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_3_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-3.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_4_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-4.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_4_0_opt and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-4.0-opt.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "holodayo_xl_2_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/holodayo-xl-2.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kivotos_xl_2_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kivotos-xl-2.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "clandestine_xl_1_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/clandestine-xl-1.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "UrangDiffusion_1_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/UrangDiffusion-1.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "RaeDiffusion_XL_v2 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/RaeDiffusion-XL-v2.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_delta_rev1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-delta-rev1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohakuXLEpsilon_rev1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohakuXLEpsilon_rev1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_epsilon_rev2 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-epsilon-rev2.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_epsilon_rev3 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-epsilon-rev3.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_zeta and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-zeta.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "starryXLV52_v52 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/starryXLV52_v52.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "heartOfAppleXL_v20 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/heartOfAppleXL_v20.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "heartOfAppleXL_v30 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/heartOfAppleXL_v30.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sanaexlAnimeV10_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sanaexlAnimeV10_v10.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sanaexlAnimeV10_v11 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sanaexlAnimeV10_v11.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "SanaeXL_Anime_v1_2_aesthetic and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/SanaeXL-Anime-v1.2-aesthetic.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "SanaeXL_Anime_v1_3_aesthetic and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/SanaeXL-Anime-v1.3-aesthetic.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v0_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v0.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v0_1_GUIDED and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v0.1-GUIDED.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v1_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v1.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v1_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v1.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v2_0_stable and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v2.0-stable.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "jruTheJourneyRemains_v25XL and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/jruTheJourneyRemains_v25XL.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_earlyAccessVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_earlyAccessVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred05Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred05Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred075 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred075.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred077 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred077.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred10Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred10Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred11Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred11Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPredTestVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPredTestVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred05Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred05Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred06Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred06Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred065SVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred065SVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred075SVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred075SVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred09RVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred09RVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred10Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred10Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "ponyDiffusionV6XL_v6StartWithThisOne and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/ponyDiffusionV6XL_v6StartWithThisOne.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "pdForAnime_v20 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/pdForAnime_v20.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "omegaPonyXLAnime_v20 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/omegaPonyXLAnime_v20.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "# VAE 模型\n",
        "vae_ft_ema_560000_ema_pruned and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/sd_1.5/vae-ft-ema-560000-ema-pruned.safetensors\", \"type\": \"VAE\"})\n",
        "vae_ft_mse_840000_ema_pruned and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/sd_1.5/vae-ft-mse-840000-ema-pruned.safetensors\", \"type\": \"VAE\"})\n",
        "sdxl_fp16_fix_vae and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/sdxl_1.0/sdxl_fp16_fix_vae.safetensors\", \"type\": \"VAE\"})\n",
        "# VAE Approx 模型\n",
        "vae_approx_model and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/vae-approx/model.pt\", \"type\": \"VAE-approx\"})\n",
        "vae_approx_sdxl and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/vae-approx/vaeapprox-sdxl.pt\", \"type\": \"VAE-approx\"})\n",
        "vae_approx_sd3 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/vae-approx/vaeapprox-sd3.pt\", \"type\": \"VAE-approx\"})\n",
        "# 放大模型\n",
        "upscale_dat_x2 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/DAT/DAT_x2.pth\", \"type\": \"DAT\"})\n",
        "upscale_dat_x3 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/DAT/DAT_x3.pth\", \"type\": \"DAT\"})\n",
        "upscale_dat_x4 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/DAT/DAT_x4.pth\", \"type\": \"DAT\"})\n",
        "upscale_4x_nmkd_superscale_sp_178000_g and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/ESRGAN/4x_NMKD-Superscale-SP_178000_G.pth\", \"type\": \"ESRGAN\"})\n",
        "upscale_8x_nmkd_superscale_150000_g and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/ESRGAN/8x_NMKD-Superscale_150000_G.pth\", \"type\": \"ESRGAN\"})\n",
        "upscale_lollypop and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/ESRGAN/lollypop.pth\", \"type\": \"ESRGAN\"})\n",
        "upscale_realesrgan_x4plus and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/RealESRGAN/RealESRGAN_x4plus.pth\", \"type\": \"RealESRGAN\"})\n",
        "upscale_realesrgan_x4plus_anime_6b and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth\", \"type\": \"RealESRGAN\"})\n",
        "upscale_swinir_4x and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/SwinIR/SwinIR_4x.pth\", \"type\": \"SwinIR\"})\n",
        "# ControlNet 模型\n",
        "illustriousxlcanny_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLCanny_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxllineart_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLLineart_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxldepth_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLDepth_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlsoftedge_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLSoftedge_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxllineartrrealistic_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLLineartRrealistic_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlshuffle_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLShuffle_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlopenpose_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLOpenPose_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxltile_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLTile_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv0_1_inpainting_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv0.1_inpainting_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_canny_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_canny_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_depth_midas_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_depth_midas_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_inpainting_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_inpainting_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_tile_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_tile_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epscanny and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsCanny.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsdepthmidas and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsDepthMidas.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epslineartanime and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsLineartAnime.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsnormalmidas and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsNormalMidas.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epssoftedgehed and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsSoftedgeHed.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsmangaline and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsMangaLine.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epslineartrealistic and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsLineartRealistic.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsdepthmidasv11 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsDepthMidasV11.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsscribblehed and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsScribbleHed.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsscribblepidinet and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsScribblePidinet.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_openposemodel and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_openposeModel.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epstile and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsTile.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobai_inpainting_controlnet and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/NoobAI_Inpainting_ControlNet.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobipamark1_mark1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/controlnet_v1.1/resolve/main/noobIPAMARK1_mark1.safetensors\", \"type\": \"ControlNet\"})\n",
        "\n",
        "# @markdown ---\n",
        "##############################################################################\n",
        "# @markdown ## 额外挂载目录设置, 在启动时挂载目录到 Google Drive：\n",
        "EXTRA_LINK_DIR = []\n",
        "\n",
        "#@markdown - models/Stable-diffusion 目录\n",
        "link_stable_diffusion_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/Lora 目录\n",
        "link_lora_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/VAE 目录\n",
        "link_vae_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/VAE-approx 目录\n",
        "link_vae_approx_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/text_encoder 目录\n",
        "link_text_encoder_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/CLIP 目录\n",
        "link_clip_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - embeddings 目录\n",
        "link_embeddings_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/RealESRGAN 目录\n",
        "link_realesrgan_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/GFPGAN 目录\n",
        "link_gfpgan_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/ESRGAN 目录\n",
        "link_esrgan_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/DAT 目录\n",
        "link_dat_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/diffusers 目录\n",
        "link_diffusers_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/ControlNet 目录\n",
        "link_controlnet_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/hypernetworks 目录\n",
        "link_hypernetworks_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/layer_model 目录\n",
        "link_layer_model_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/svd 目录\n",
        "link_svd_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - models/z123 目录\n",
        "link_z123_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - extensions 目录\n",
        "link_extensions_dir = False # @param {type:\"boolean\"}\n",
        "#@markdown - cache 目录\n",
        "link_cache_dir = False # @param {type:\"boolean\"}\n",
        "\n",
        "\n",
        "link_stable_diffusion_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/Stable-diffusion\"})\n",
        "link_lora_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/Lora\"})\n",
        "link_vae_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/VAE\"})\n",
        "link_vae_approx_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/VAE-approx\"})\n",
        "link_text_encoder_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/text_encoder\"})\n",
        "link_clip_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/CLIP\"})\n",
        "link_embeddings_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"embeddings\"})\n",
        "link_realesrgan_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/RealESRGAN\"})\n",
        "link_gfpgan_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/GFPGAN\"})\n",
        "link_esrgan_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/ESRGAN\"})\n",
        "link_dat_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/DAT\"})\n",
        "link_diffusers_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/diffusers\"})\n",
        "link_controlnet_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/ControlNet\"})\n",
        "link_hypernetworks_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/hypernetworks\"})\n",
        "link_layer_model_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/layer_model\"})\n",
        "link_svd_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/svd\"})\n",
        "link_z123_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"models/z123\"})\n",
        "link_extensions_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"extensions\"})\n",
        "link_cache_dir and EXTRA_LINK_DIR.append({\"link_dir\": \"cache\"})\n",
        "\n",
        "##############################################################################\n",
        "\n",
        "INSTALL_PARAMS = {\n",
        "    \"torch_ver\": PYTORCH_VER or None,\n",
        "    \"xformers_ver\": XFORMERS_VER or None,\n",
        "    \"use_uv\": USE_UV,\n",
        "    \"pypi_index_mirror\": PIP_INDEX_MIRROR or None,\n",
        "    \"pypi_extra_index_mirror\": PIP_EXTRA_INDEX_MIRROR or None,\n",
        "    \"pypi_find_links_mirror\": PIP_FIND_LINKS_MIRROR or None,\n",
        "    # Colab 的环境暂不需要以下镜像源\n",
        "    # \"github_mirror\": GITHUB_MIRROR or None,\n",
        "    # \"huggingface_mirror\": HUGGINGFACE_MIRROR or None,\n",
        "    \"pytorch_mirror\": PYTORCH_MIRROR or None,\n",
        "    \"sd_webui_repo\": SD_WEBUI_REPO or None,\n",
        "    \"sd_webui_branch\": SD_WEBUI_BRANCH or None,\n",
        "    \"sd_webui_requirements\": SD_WEBUI_REQUIREMENTS or None,\n",
        "    \"sd_webui_requirements_url\": SD_WEBUI_REQUIREMENTS_URL or None,\n",
        "    \"sd_webui_setting\": SD_WEBUI_SETTING or None,\n",
        "    \"extension_list\": EXTENSION_LIST,\n",
        "    \"model_list\": SD_MODEL,\n",
        "    \"check_avaliable_gpu\": CHECK_AVALIABLE_GPU,\n",
        "    \"enable_tcmalloc\": ENABLE_TCMALLOC,\n",
        "    \"enable_cuda_malloc\": ENABLE_CUDA_MALLOC,\n",
        "    \"custom_sys_pkg_cmd\": None,\n",
        "    \"huggingface_token\": None,\n",
        "    \"modelscope_token\": None,\n",
        "    \"update_core\": UPDATE_CORE,\n",
        "}\n",
        "\n",
        "TUNNEL_PARAMS = {\n",
        "    \"use_ngrok\": USE_NGROK,\n",
        "    \"ngrok_token\": NGROK_TOKEN or None,\n",
        "    \"use_cloudflare\": USE_CLOUDFLARE,\n",
        "    \"use_remote_moe\": USE_REMOTE_MOE,\n",
        "    \"use_localhost_run\": USE_LOCALHOST_RUN,\n",
        "    \"use_gradio\": USE_GRADIO,\n",
        "    \"use_pinggy_io\": USE_PINGGY_IO,\n",
        "    \"use_zrok\": USE_ZROK,\n",
        "    \"zrok_token\": ZROK_TOKEN or None,\n",
        "    \"message\": \"##### Stable Diffusion WebUI 访问地址 #####\",\n",
        "}\n",
        "\n",
        "SD_WEBUI_PATH = \"/content/stable-diffusion-webui\"\n",
        "try:\n",
        "    _ = sd_webui_manager_has_init # type: ignore  # noqa: F821\n",
        "except Exception:\n",
        "    sd_webui = SDWebUIManager(os.path.dirname(SD_WEBUI_PATH), os.path.basename(SD_WEBUI_PATH), port=7860)\n",
        "    sd_webui_manager_has_init = True\n",
        "\n",
        "try:\n",
        "    _ = sd_webui_has_init # type: ignore  # noqa: F821\n",
        "except Exception:\n",
        "    sd_webui_has_init = False\n",
        "\n",
        "if NO_REPEAT_CONFIGURE_ENV:\n",
        "    if not sd_webui_has_init:\n",
        "        sd_webui.install(**INSTALL_PARAMS)\n",
        "        INIT_CONFIG = 1\n",
        "        sd_webui_has_init = True\n",
        "        CLEAR_LOG and sd_webui.clear_up()\n",
        "        logger.info(\"Stable Diffusion WebUI 运行环境配置完成\")\n",
        "    else:\n",
        "        logger.info(\"检测到不重复配置环境已启用, 并且在当前 Colab 实例中已配置 Stable Diffusion WebUI 运行环境, 不再重复配置 Stable Diffusion WebUI 运行环境\")\n",
        "        logger.info(\"如需在当前 Colab 实例中重新配置 Stable Diffusion WebUI 运行环境, 请在快速启动选项中取消不重复配置环境功能\")\n",
        "else:\n",
        "    sd_webui.install(**INSTALL_PARAMS)\n",
        "    INIT_CONFIG = 1\n",
        "    CLEAR_LOG and sd_webui.clear_up()\n",
        "    logger.info(\"Stable Diffusion WebUI 运行环境配置完成\")\n",
        "\n",
        "if USE_GRADIO:\n",
        "    SD_WEBUI_LAUNCH_ARGS = f\"{SD_WEBUI_LAUNCH_ARGS} --share\"\n",
        "\n",
        "LAUNCH_CMD = sd_webui.get_launch_command(SD_WEBUI_LAUNCH_ARGS)\n",
        "\n",
        "if QUICK_LAUNCH:\n",
        "    logger.info(\"启动 Stable Diffusion WebUI 中\")\n",
        "    os.chdir(SD_WEBUI_PATH)\n",
        "    sd_webui.check_env(\n",
        "        use_uv=USE_UV,\n",
        "        requirements_file=SD_WEBUI_REQUIREMENTS,\n",
        "    )\n",
        "    sd_webui.mount_drive(EXTRA_LINK_DIR)\n",
        "    sd_webui.tun.start_tunnel(**TUNNEL_PARAMS)\n",
        "    logger.info(\"Stable Diffusion WebUI 启动参数: %s\", SD_WEBUI_LAUNCH_ARGS)\n",
        "    !{LAUNCH_CMD}\n",
        "    os.chdir(JUPYTER_ROOT_PATH)\n",
        "    CLEAR_LOG and sd_webui.clear_up()\n",
        "    logger.info(\"已关闭 Stable Diffusion WebUI\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "ZWnei0cZwWzK"
      },
      "outputs": [],
      "source": [
        "#@title 👇 下载模型（可选）\n",
        "\n",
        "try:\n",
        "    _ = INIT_CONFIG\n",
        "except Exception:\n",
        "    raise Exception(\"未安装 Stable Diffusion WebUI\")\n",
        "\n",
        "#@markdown 选择下载的模型：\n",
        "##############################\n",
        "SD_MODEL = []\n",
        "\n",
        "# @markdown - Stable Diffusion 模型\n",
        "v1_5_pruned_emaonly = False # @param  {type:\"boolean\"}\n",
        "animefull_final_pruned = False # @param  {type:\"boolean\"}\n",
        "sd_xl_base_1_0_0_9vae = False # @param  {type:\"boolean\"}\n",
        "sd_xl_refiner_1_0_0_9vae = False # @param  {type:\"boolean\"}\n",
        "sd_xl_turbo_1_0_fp16 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_3_0_base = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_3_0 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_3_1 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_4_0 = False # @param  {type:\"boolean\"}\n",
        "animagine_xl_4_0_opt = False # @param  {type:\"boolean\"}\n",
        "holodayo_xl_2_1 = False # @param  {type:\"boolean\"}\n",
        "kivotos_xl_2_0 = False # @param  {type:\"boolean\"}\n",
        "clandestine_xl_1_0 = False # @param  {type:\"boolean\"}\n",
        "UrangDiffusion_1_1 = False # @param  {type:\"boolean\"}\n",
        "RaeDiffusion_XL_v2 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_delta_rev1 = False # @param  {type:\"boolean\"}\n",
        "kohakuXLEpsilon_rev1 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_epsilon_rev2 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_epsilon_rev3 = False # @param  {type:\"boolean\"}\n",
        "kohaku_xl_zeta = False # @param  {type:\"boolean\"}\n",
        "starryXLV52_v52 = False # @param  {type:\"boolean\"}\n",
        "heartOfAppleXL_v20 = False # @param  {type:\"boolean\"}\n",
        "heartOfAppleXL_v30 = False # @param  {type:\"boolean\"}\n",
        "sanaexlAnimeV10_v10 = False # @param  {type:\"boolean\"}\n",
        "sanaexlAnimeV10_v11 = False # @param  {type:\"boolean\"}\n",
        "SanaeXL_Anime_v1_2_aesthetic = False # @param  {type:\"boolean\"}\n",
        "SanaeXL_Anime_v1_3_aesthetic = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v0_1 = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v0_1_GUIDED = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v1_0 = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v1_1 = False # @param  {type:\"boolean\"}\n",
        "Illustrious_XL_v2_0_stable = False # @param  {type:\"boolean\"}\n",
        "jruTheJourneyRemains_v25XL = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_earlyAccessVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred05Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred075 = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred077 = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred10Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_epsilonPred11Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPredTestVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred05Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred06Version = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred065SVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred075SVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred09RVersion = False # @param  {type:\"boolean\"}\n",
        "noobaiXLNAIXL_vPred10Version = False # @param  {type:\"boolean\"}\n",
        "ponyDiffusionV6XL_v6StartWithThisOne = False # @param  {type:\"boolean\"}\n",
        "pdForAnime_v20 = False # @param  {type:\"boolean\"}\n",
        "omegaPonyXLAnime_v20 = False # @param  {type:\"boolean\"}\n",
        "# @markdown - VAE 模型\n",
        "vae_ft_ema_560000_ema_pruned = False # @param  {type:\"boolean\"}\n",
        "vae_ft_mse_840000_ema_pruned = False # @param  {type:\"boolean\"}\n",
        "sdxl_fp16_fix_vae = False # @param  {type:\"boolean\"}\n",
        "# @markdown - Upscale 模型\n",
        "upscale_dat_x2 = False # @param {type:\"boolean\"}\n",
        "upscale_dat_x3 = False # @param {type:\"boolean\"}\n",
        "upscale_dat_x4 = False # @param {type:\"boolean\"}\n",
        "upscale_4x_nmkd_superscale_sp_178000_g = False # @param {type:\"boolean\"}\n",
        "upscale_8x_nmkd_superscale_150000_g = False # @param {type:\"boolean\"}\n",
        "upscale_lollypop = False # @param {type:\"boolean\"}\n",
        "upscale_realesrgan_x4plus = False # @param {type:\"boolean\"}\n",
        "upscale_realesrgan_x4plus_anime_6b = False # @param {type:\"boolean\"}\n",
        "upscale_swinir_4x = False # @param {type:\"boolean\"}\n",
        "# @markdown - ControlNet 模型\n",
        "illustriousxlcanny_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxllineart_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxldepth_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlsoftedge_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxllineartrrealistic_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlshuffle_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlopenpose_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxltile_v10 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv0_1_inpainting_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_canny_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_depth_midas_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_inpainting_fp16 = False # @param {type:\"boolean\"}\n",
        "illustriousxlv1_1_tile_fp16 = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epscanny = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsdepthmidas = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epslineartanime = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsnormalmidas = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epssoftedgehed = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsmangaline = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epslineartrealistic = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsdepthmidasv11 = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsscribblehed = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epsscribblepidinet = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_openposemodel = False # @param {type:\"boolean\"}\n",
        "noobaixlcontrolnet_epstile = False # @param {type:\"boolean\"}\n",
        "noobai_inpainting_controlnet = False # @param {type:\"boolean\"}\n",
        "noobipamark1_mark1 = False # @param {type:\"boolean\"}\n",
        "\n",
        "\n",
        "# Stable Diffusion 模型\n",
        "v1_5_pruned_emaonly and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sd_1.5/v1-5-pruned-emaonly.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animefull_final_pruned and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sd_1.5/animefull-final-pruned.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sd_xl_base_1_0_0_9vae and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sd_xl_base_1.0_0.9vae.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sd_xl_refiner_1_0_0_9vae and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sd_xl_refiner_1.0_0.9vae.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sd_xl_turbo_1_0_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sd_xl_turbo_1.0_fp16.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_3_0_base and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-3.0-base.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_3_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-3.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_3_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-3.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_4_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-4.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "animagine_xl_4_0_opt and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/animagine-xl-4.0-opt.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "holodayo_xl_2_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/holodayo-xl-2.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kivotos_xl_2_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kivotos-xl-2.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "clandestine_xl_1_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/clandestine-xl-1.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "UrangDiffusion_1_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/UrangDiffusion-1.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "RaeDiffusion_XL_v2 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/RaeDiffusion-XL-v2.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_delta_rev1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-delta-rev1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohakuXLEpsilon_rev1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohakuXLEpsilon_rev1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_epsilon_rev2 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-epsilon-rev2.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_epsilon_rev3 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-epsilon-rev3.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "kohaku_xl_zeta and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/kohaku-xl-zeta.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "starryXLV52_v52 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/starryXLV52_v52.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "heartOfAppleXL_v20 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/heartOfAppleXL_v20.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "heartOfAppleXL_v30 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/heartOfAppleXL_v30.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sanaexlAnimeV10_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sanaexlAnimeV10_v10.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "sanaexlAnimeV10_v11 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/sanaexlAnimeV10_v11.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "SanaeXL_Anime_v1_2_aesthetic and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/SanaeXL-Anime-v1.2-aesthetic.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "SanaeXL_Anime_v1_3_aesthetic and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/SanaeXL-Anime-v1.3-aesthetic.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v0_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v0.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v0_1_GUIDED and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v0.1-GUIDED.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v1_0 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v1.0.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v1_1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v1.1.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "Illustrious_XL_v2_0_stable and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/Illustrious-XL-v2.0-stable.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "jruTheJourneyRemains_v25XL and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/jruTheJourneyRemains_v25XL.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_earlyAccessVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_earlyAccessVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred05Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred05Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred075 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred075.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred077 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred077.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred10Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred10Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_epsilonPred11Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_epsilonPred11Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPredTestVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPredTestVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred05Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred05Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred06Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred06Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred065SVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred065SVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred075SVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred075SVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred09RVersion and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred09RVersion.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "noobaiXLNAIXL_vPred10Version and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/noobaiXLNAIXL_vPred10Version.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "ponyDiffusionV6XL_v6StartWithThisOne and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/ponyDiffusionV6XL_v6StartWithThisOne.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "pdForAnime_v20 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/pdForAnime_v20.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "omegaPonyXLAnime_v20 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-model/resolve/main/sdxl_1.0/omegaPonyXLAnime_v20.safetensors\", \"type\": \"Stable-diffusion\"})\n",
        "# VAE 模型\n",
        "vae_ft_ema_560000_ema_pruned and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/sd_1.5/vae-ft-ema-560000-ema-pruned.safetensors\", \"type\": \"VAE\"})\n",
        "vae_ft_mse_840000_ema_pruned and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/sd_1.5/vae-ft-mse-840000-ema-pruned.safetensors\", \"type\": \"VAE\"})\n",
        "sdxl_fp16_fix_vae and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-vae/resolve/main/sdxl_1.0/sdxl_fp16_fix_vae.safetensors\", \"type\": \"VAE\"})\n",
        "# 放大模型\n",
        "upscale_dat_x2 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/DAT/DAT_x2.pth\", \"type\": \"DAT\"})\n",
        "upscale_dat_x3 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/DAT/DAT_x3.pth\", \"type\": \"DAT\"})\n",
        "upscale_dat_x4 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/DAT/DAT_x4.pth\", \"type\": \"DAT\"})\n",
        "upscale_4x_nmkd_superscale_sp_178000_g and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/ESRGAN/4x_NMKD-Superscale-SP_178000_G.pth\", \"type\": \"ESRGAN\"})\n",
        "upscale_8x_nmkd_superscale_150000_g and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/ESRGAN/8x_NMKD-Superscale_150000_G.pth\", \"type\": \"ESRGAN\"})\n",
        "upscale_lollypop and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/ESRGAN/lollypop.pth\", \"type\": \"ESRGAN\"})\n",
        "upscale_realesrgan_x4plus and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/RealESRGAN/RealESRGAN_x4plus.pth\", \"type\": \"RealESRGAN\"})\n",
        "upscale_realesrgan_x4plus_anime_6b and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth\", \"type\": \"RealESRGAN\"})\n",
        "upscale_swinir_4x and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd-upscaler-models/resolve/main/SwinIR/SwinIR_4x.pth\", \"type\": \"SwinIR\"})\n",
        "# ControlNet 模型\n",
        "illustriousxlcanny_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLCanny_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxllineart_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLLineart_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxldepth_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLDepth_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlsoftedge_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLSoftedge_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxllineartrrealistic_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLLineartRrealistic_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlshuffle_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLShuffle_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlopenpose_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLOpenPose_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxltile_v10 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLTile_v10.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv0_1_inpainting_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv0.1_inpainting_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_canny_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_canny_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_depth_midas_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_depth_midas_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_inpainting_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_inpainting_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "illustriousxlv1_1_tile_fp16 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/illustriousXLv1.1_tile_fp16.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epscanny and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsCanny.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsdepthmidas and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsDepthMidas.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epslineartanime and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsLineartAnime.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsnormalmidas and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsNormalMidas.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epssoftedgehed and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsSoftedgeHed.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsmangaline and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsMangaLine.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epslineartrealistic and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsLineartRealistic.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsdepthmidasv11 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsDepthMidasV11.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsscribblehed and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsScribbleHed.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epsscribblepidinet and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsScribblePidinet.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_openposemodel and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_openposeModel.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobaixlcontrolnet_epstile and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/noobaiXLControlnet_epsTile.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobai_inpainting_controlnet and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/sd_control_collection/resolve/main/NoobAI_Inpainting_ControlNet.safetensors\", \"type\": \"ControlNet\"})\n",
        "noobipamark1_mark1 and SD_MODEL.append({\"url\": \"https://huggingface.co/licyk/controlnet_v1.1/resolve/main/noobIPAMARK1_mark1.safetensors\", \"type\": \"ControlNet\"})\n",
        "\n",
        "##############################\n",
        "logger.info(\"下载模型中\")\n",
        "sd_webui.get_sd_model_from_list(SD_MODEL)\n",
        "CLEAR_LOG and sd_webui.clear_up()\n",
        "logger.info(\"模型下载完成\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "MbpZVvRMPIAC"
      },
      "outputs": [],
      "source": [
        "#@title 👇 自定义模型下载\n",
        "try:\n",
        "    _ = INIT_CONFIG\n",
        "except Exception:\n",
        "    raise Exception(\"未安装 Stable Diffusion WebUI\")\n",
        "\n",
        "#@markdown ### 选择模型种类：\n",
        "model_type = \"Lora\" # @param [\"Stable-diffusion\", \"Lora\", \"VAE\", \"VAE-approx\", \"text_encoder\", \"CLIP\", \"embeddings\", \"RealESRGAN\", \"GFPGAN\", \"ESRGAN\", \"DAT\", \"diffusers\", \"ControlNet\", \"hypernetworks\", \"layer_model\", \"svd\", \"z123\"]:\n",
        "#@markdown ### 填写模型的下载链接：\n",
        "model_url = \"https://huggingface.co/licyk/sd-lora/resolve/main/sdxl/style/CoolFlatColor.safetensors\"  #@param {type:\"string\"}\n",
        "#@markdown ### 填写模型的名称（包括后缀名）：\n",
        "model_name = \"CoolFlatColor.safetensors\"  #@param {type:\"string\"}\n",
        "\n",
        "sd_webui.get_sd_model(\n",
        "    url=model_url,\n",
        "    filename=model_name or None,\n",
        "    model_type=model_type,\n",
        ")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "8y0FPv15wHP9"
      },
      "outputs": [],
      "source": [
        "#@title 👇 扩展下载\n",
        "try:\n",
        "    _ = INIT_CONFIG\n",
        "except Exception:\n",
        "    raise Exception(\"未安装 Stable Diffusion WebUI\")\n",
        "\n",
        "#@markdown ### 填写扩展的下载链接：\n",
        "extension_url = \"https://github.com/michP247/auto-noise-schedule\"  #@param {type:\"string\"}\n",
        "\n",
        "sd_webui.install_extension(extension_url)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "cLB6sKhErcG8"
      },
      "outputs": [],
      "source": [
        "#@title 👇 启动 Stable Diffusion WebUI\n",
        "try:\n",
        "    _ = INIT_CONFIG\n",
        "except Exception:\n",
        "    raise Exception(\"未安装 Stable Diffusion WebUI\")\n",
        "\n",
        "logger.info(\"启动 Stable Diffusion WebUI\")\n",
        "os.chdir(SD_WEBUI_PATH)\n",
        "sd_webui.check_env(\n",
        "    use_uv=USE_UV,\n",
        "    requirements_file=SD_WEBUI_REQUIREMENTS,\n",
        ")\n",
        "sd_webui.mount_drive(EXTRA_LINK_DIR)\n",
        "sd_webui.tun.start_tunnel(**TUNNEL_PARAMS)\n",
        "logger.info(\"Stable Diffusion WebUI 启动参数: %s\", SD_WEBUI_LAUNCH_ARGS)\n",
        "!{LAUNCH_CMD}\n",
        "os.chdir(JUPYTER_ROOT_PATH)\n",
        "CLEAR_LOG and sd_webui.clear_up()\n",
        "logger.info(\"已关闭 Stable Diffusion WebUI\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "AVWoNIEhXy5o"
      },
      "outputs": [],
      "source": [
        "#@title 👇 文件下载工具\n",
        "\n",
        "#@markdown ### 填写文件的下载链接：\n",
        "url = \"\"  #@param {type:\"string\"}\n",
        "#@markdown ### 填写文件的保存路径：\n",
        "file_path = \"/content\"  #@param {type:\"string\"}\n",
        "#@markdown ### 填写文件的保存名称 (可选)：\n",
        "filename = \"\"  #@param {type:\"string\"}\n",
        "\n",
        "sd_webui.download_file(\n",
        "    url=url,\n",
        "    path=file_path or None,\n",
        "    save_name=filename or None,\n",
        ")\n"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "gpuType": "T4",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.11.8"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
